// view/index/addyuan/addyuan.js
let app = getApp()
let yuming = app.globalData.yuming
let mobile = app.globalData.mobile
let sfzza = app.globalData.sfzza 
var chaninese = app.globalData.chaninese
const request = require('../../config/request');
const util = require('../../config/util');
// var jiankaishi = util.ynian(new Date())
var jiankaishi = '2022-01-01'
Page({
    ...request,
    /**
     * 页面的初始数据
     */
    data: {
        scene: '',
        xuan_list: [],
        isjkz: false,
        isbyz: false,
        iszcz: false,
        iszgz: false,
        jinghe_id: '',
        buttonClicked: false,
        s2: false,
        yuming: yuming,
        heights: "",
        yiyao: '',
        title: '添加员工',
        xingming: '', //姓名
        dianhua: '', //电话
        shenfenz: '', //身份证号
        zhiweiid: '', //职位id
        qutime: '', //取证时间
        daotime: '', //有效期至
        zhan: '',
        zhiguo: '请选择职位',
        // zhilist: [{ name: '店长', id: 2}, {  name: '员工', id: 3 }], //职位
        zhiindex: 0, //职位index
        date: '', //开始
        dates: '', //结束
        jkz: '', //健康证照片
        cyz: '', //注册证图片

        otherimg: "",
        wuotherimg: "",
        wujkz: '',
        wucyz: '',
        cyzdatequ: '', //注册证
        cyzdatedao: '', //注册证

        otherqu: '', //注册证
        otheryou: '', //注册证
        otherquChuan:"",
        otheryouChuan:"",
        cyzdatequs: '', //注册证
        cyzdatedaos: '', //注册证
        jkzzjlx: '', //健康证证件类型
        cyzzjlx: '', //注册证证件类型
        fdaaa: '',
        fdimg: '',
        Position: '', //职位
        inputHeight: 0,
        istoken: 0, //0不要token,1需要token
        bytime: '请选择毕业证取证时间',
        zgtime: '',
        zgtimes: '',
        bytimes: '',
        zgz: '',
        byz: '',
        wuzgz: '',
        jkis_dian: false,
        byis_dian: false,
        zcis_dian: false,
        zgis_dian: false,
        otherszheng: false,
        wubyz: '',
        jiankaishi: jiankaishi, //健康证的开始时间
        zhucekaishi: '2020-01-01', //注册开始时间
    },
    xizheng(e) {
        var index = e.currentTarget.dataset.index;
        var name = e.currentTarget.dataset.name;
        var item = this.data.xuan_list
        item[index].checked = !item[index].checked
     
        if (this.data.hangyeid == 6) {
            if (index == 0) {
                if (this.data.xuan_list[0].checked) {
                    this.setData({
                        isjkz: true
                    })
                } else {
                    this.setData({
                        isjkz: false
                    })
                }
            }
            if (index == 1) {
                if (this.data.xuan_list[1].checked) {
                    this.setData({
                        iszcz: true
                    })
                } else {
                    this.setData({
                        iszcz: false
                    })
                }
            }
            if (index == 2) {
                if (this.data.xuan_list[2].checked) {
                    this.setData({
                        iszgz: true
                    })
                } else {
                    this.setData({
                        iszgz: false
                    })
                }
            }
            if (index == 3) {
                if (this.data.xuan_list[3].checked) {
                    this.setData({
                        otherszheng: true
                    })
                } else {
                    this.setData({
                        otherszheng: false
                    })
                }
            }
        } else {
            if (index == 0) {
                if (this.data.xuan_list[0].checked) {
                    this.setData({
                        isjkz: true
                    })
                } else {
                    this.setData({
                        isjkz: false
                    })
                }
            }
            if (index == 1) {
                if (this.data.xuan_list[1].checked) {
                    this.setData({
                        iszcz: true
                    })
                } else {
                    this.setData({
                        iszcz: false
                    })
                }
            }
            if (index == 2) {
                if (this.data.xuan_list[2].checked) {
                    this.setData({
                        // iszgz: true
                        otherszheng: true

                    })
                } else {
                    this.setData({
                        // iszgz: false
                        otherszheng: false

                    })
                }
            }
            if (index == 3) {
                if (this.data.xuan_list[3].checked) {
                    this.setData({
                        otherszheng: true
                    })
                } else {
                    this.setData({
                        otherszheng: false
                    })
                }
            }
        }

        this.setData({
            xuan_list: item
        })
    },
    showModal(e) {
        var aaa = e.currentTarget.dataset.aaa
        var img = e.currentTarget.dataset.img
        this.setData({
            fdaaa: aaa,
            fdimg: img
        })
        let {
            type
        } = e.currentTarget.dataset, va = '';
        if (type == 's2') {
            va = "s2";
        }
        this.setData({
            [va]: true
        })
    },
    confirmbtn(e) {
        console.log(e)
        console.log('点击了从新上传！')
        var aaa = this.data.fdaaa
        var that = this;
        this.myChooseImage(1).then(res => {
            const tempFilePaths = res.tempFilePaths
            this.myUploadImg(tempFilePaths[0], 'file').then(res => {
                var data = JSON.parse(res.data)
                wx.showToast({
                    title: data.msg,
                    icon: 'none'
                })
                var urls = data.httpUrl + data.imgUrl
                if (aaa == 0) {
                    that.setData({
                        jkz: urls,
                        wujkz: data.imgUrl,
                        jkis_dian: true,
                    });
                }
                if (aaa == 1) {
                    that.setData({
                        cyz: urls,
                        wucyz: data.imgUrl,
                        zcis_dian: true
                    });
                }
                if (aaa == 2) {
                    that.setData({
                        byz: urls,
                        wubyz: data.imgUrl,
                        byis_dian: true
                    });
                }
                if (aaa == 3) {
                    that.setData({
                        zgz: urls,
                        wuzgz: data.imgUrl,
                        zgis_dian: true
                    });
                }
            })
        })

    },
    cancelBtn() {
        console.log('点击了放大！')
        wx.previewImage({
            urls: [this.data.fdimg]
        })
    },
    getIptValue(e) {
        console.log(e.detail)
    },
    // 保存验证
    jing_xubaocun() {
        if (this.data.xingming == '') {
            wx.showToast({
                title: '请输入姓名',
                icon: 'none'
            })
        } else if (this.data.dianhua == '') {
            wx.showToast({
                title: '请输入联系电话',
                icon: 'none'
            })
        } else if (this.data.dianhua.length != 11) {
            wx.showToast({
                title: '请输入11位手机号',
                icon: 'none'
            })
        } else if (mobile.test(this.data.dianhua) == false) {
            wx.showToast({
                title: '请输入正确的手机号',
                icon: 'none'
            })
        } else if (this.data.shenfenz == '') {
            wx.showToast({
                title: '请输入身份证号',
                icon: 'none'
            })
        } else if (this.data.shenfenz.length != 18) {
            wx.showToast({
                title: '请输入18位身份证号',
                icon: 'none'
            })
        } else if (sfzza.test(this.data.shenfenz) == false) {
            wx.showToast({
                title: '请输入有效身份证号',
                icon: 'none'
            })
        } else if (this.data.Position == '') {
            wx.showToast({
                title: '请输入职务',
                icon: 'none'
            })
        } else if (!this.data.isjkz && !this.data.isbyz && !this.data.iszcz && !this.data.iszgz) {
            this.queding()
        } else {
            // 选了健康证
            if (this.data.isjkz) {
                console.log('走了健康证')
                if (this.data.date == '') {
                    wx.showToast({
                        title: '请选择健康证取证时间',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.jkz == '') {
                    wx.showToast({
                        title: '请上传健康证',
                        icon: 'none'
                    })
                    return
                }
            }
            // 走了毕业证 
            if (this.data.isbyz) {
                console.log('走了毕业证 ')
                if (this.data.bytime == '请选择毕业证取证时间') {
                    wx.showToast({
                        title: '请选择毕业证取证时间',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.byz == '') {
                    wx.showToast({
                        title: '请上传毕业证',
                        icon: 'none'
                    })
                    return
                }
            }
            // 走了注册证 
            if (this.data.iszcz) {
                console.log('走了注册证')
                if (this.data.cyzdatequ == '') {
                    wx.showToast({
                        title: '请选择资格证取证时间',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.cyzdatedao == '') {
                    wx.showToast({
                        title: '请选择资格证有效期',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.cyz == '') {
                    wx.showToast({
                        title: '请上传注册证',
                        icon: 'none'
                    })
                    return
                }
            }
            // 走了资格证
            if (this.data.iszgz) {
                console.log('走了资格证')
                if (this.data.zgtime == '') {
                    wx.showToast({
                        title: '请选择资格证有效期',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.zgz == '') {
                    wx.showToast({
                        title: '请上传资格证',
                        icon: 'none'
                    })
                    return
                }
            }
            this.queding()
        }
    },
    // 保存验证
    xubaocun() {
        if (this.data.xingming == '') {
            wx.showToast({
                title: '请输入姓名',
                icon: 'none'
            })
        } else if (this.data.dianhua == '') {
            wx.showToast({
                title: '请输入联系电话',
                icon: 'none'
            })
        } else if (this.data.dianhua.length != 11) {
            wx.showToast({
                title: '请输入11位手机号',
                icon: 'none'
            })
        } else if (mobile.test(this.data.dianhua) == false) {
            wx.showToast({
                title: '请输入正确的手机号',
                icon: 'none'
            })
        } else if (this.data.shenfenz == '') {
            wx.showToast({
                title: '请输入身份证号',
                icon: 'none'
            })
        } else if (this.data.shenfenz.length != 18) {
            wx.showToast({
                title: '请输入18位身份证号',
                icon: 'none'
            })
        } else if (sfzza.test(this.data.shenfenz) == false) {
            wx.showToast({
                title: '请输入有效身份证号',
                icon: 'none'
            })
        } else if (this.data.Position == '') {
            wx.showToast({
                title: '请输入职务',
                icon: 'none'
            })
        } else if (!this.data.isjkz && !this.data.otherszheng && !this.data.iszcz && !this.data.iszgz ) {
            // this.quedings()
            wx.showToast({
              title: '请上传证件',
              icon:'error'
            })
        } else {
            // 选了健康证
            if (this.data.isjkz) {
                console.log('走了健康证')
                if (this.data.date == '') {
                    wx.showToast({
                        title: '请选择健康证取证时间',
                        icon: 'none'
                    })
                    return
                }
                if (this.data.jkz == '') {
                    wx.showToast({
                        title: '请上传健康证',
                        icon: 'none'
                    })
                    return
                }
            }
            // 走了注册证 
            if (this.data.iszcz) {
                console.log('走了注册证')
                // if (this.data.cyzzjlx == '') {
                //   wx.showToast({
                //     title: '请输入从业证岗位',
                //     icon: 'none'
                //   })
                //   return
                // }
                if (this.data.cyzdatequ == '') {
                  wx.showToast({
                      title: '请选择资格证取证时间',
                      icon: 'none'
                  })
                  return
              }
              if (this.data.cyzdatedao == '') {
                  wx.showToast({
                      title: '请选择资格证有效期',
                      icon: 'none'
                  })
                  return
              }
                if (this.data.cyz == '') {
                    wx.showToast({
                        title: '请上传从业证',
                        icon: 'none'
                    })
                    return
                }
            }
            if (this.data.otherszheng) {
             console.log(11);
              if (this.data.otherquChuan == '') {
                  wx.showToast({
                      title: '请选择其他证件取证时间',
                      icon: 'none'
                  })
                  return
              }
              if (this.data.otheryouChuan == '') {
                  wx.showToast({
                      title: '请选择其他证件有效期',
                      icon: 'none'
                  })
                  return
              }
              if (this.data.otherimg == '') {
                  wx.showToast({
                      title: '请上传其他证件',
                      icon: 'none'
                  })
                  return
              }
          }
            this.quedings()
        }
    },
  
    quedings() {
        // console.log(2222)
        // return
        var that = this
        wx.showModal({
            title: '确定要提交吗?',
            cancelText: '取消',
            confirmText: '确定',
            success: function (res) {
                if (res.confirm) {
                    console.log("确定")
                    that.setData({
                        buttonClicked: true
                    })
                    if (that.data.date == '') {
                        that.setData({
                            date: ''
                        })
                    }
                    if (that.data.dates == '') {
                        that.setData({
                            dates: ''
                        })
                    }
                    if (that.data.bytime == '请选择毕业证取证时间') {
                        that.setData({
                            bytime: '',
                            bytimes: ''
                        })
                    }
                    if (that.data.cyzdatequ == '') {
                        that.setData({
                            cyzdatequ: '',
                            cyzdatequs: ''
                        })
                    }
                    if (that.data.cyzdatedao == '') {
                        that.setData({
                            cyzdatedao: '',
                            cyzdatedaos: ''
                        })
                    }
                    if (that.data.zgtime == '') {
                        that.setData({
                            zgtime: '',
                            zgtimes: ''
                        })
                    }
                    let data = {
                        shopId: wx.getStorageSync('shopId'),
                        Name: that.data.xingming,
                        Phone: that.data.dianhua,
                        idNumber: that.data.shenfenz,
                        Position: that.data.Position,
                        healthyDcment: that.data.jkzzjlx, //健康证类型
                        obtainTime: that.data.date, //健康证
                        effectiveTime: that.data.dates, //健康证
                        healthyImage: that.data.wujkz, //健康证
                        practiceDcment: that.data.cyzzjlx, //从业证类型
                        // practicestarTime: that.data.zgtimes, //从业证资格证领证时间
                        // practiceendTime: that.data.zgtimes, //从业证资格证到期时间
                        // practiceImage: that.data.wuzgz, //从业证资格证

                        graduationPhoto: that.data.wubyz, //毕业照
                        graduationPuttime: that.data.bytimes, //毕业证取证时间

                        practicestarTime: that.data.cyzdatequs, //从业证资格证领证时间
                        practiceendTime: that.data.cyzdatedaos, //从业证资格证到期时间
                        practiceImage: that.data.wucyz, //从业证资格证

                         registerPhoto: that.data.wuzgz, //注册证或
                         registerPuttime: that.data.zgtime, //注册证取证时间
                         registerEndtime: that.data.zgtimes, //注册证到期时间
                         
                        istoken: that.data.istoken,
                        thatImage: that.data.wuotherimg,
                        thatStartime: that.data.otherquChuan,
                        thatEndtime: that.data.otheryouChuan
                    };
                    var urlda = ''
                    
                        urlda = 'shop/shopAddStaff'
                        console.log(data);
                    
                    that.myRequest(yuming + urlda, data, 'POST').then(res => {
                        console.log(res)
                        wx.showToast({
                            title: res.data.msg,
                            icon: 'none'
                        })
                        if (res.data.code == 200) {
                            if (that.data.istoken == 0) {
                                setTimeout(function () {
                                    wx.navigateBack({
                                        delta: 0
                                    })
                                }, 1000)
                            }
                            if (that.data.istoken == 1) {
                                that.setData({
                                    xingming: '',
                                    dianhua: '',
                                    shenfenz: '',
                                    Position: '',
                                    date: '',
                                    dates: '',
                                    jkz: '',
                                    wujkz: '',
                                    cyzdatequ: '',
                                    cyzdatedao: '',
                                    cyz: '',
                                    wucyz: '',
                                    byz: '',
                                    bytime: '',
                                    zgz: '',
                                    zgtime: '',
                                    wubyz: '',
                                    wuzgz: ''
                                })
                            }
                        } else {
                            that.setData({
                                buttonClicked: false
                            })
                        }
                    })
                } else {
                    console.log("取消")
                }
            }
        })

    },
    // 职位
    Position(e) {
        if ((chaninese.test(e.detail.value))) {
            wx.showToast({
                title: '只允许输入中文',
                icon: 'none'
            })
            this.setData({
                Position: ''
            })
        } else {
            this.setData({
                Position: e.detail.value
            })
        }
    },
    // 输入健康证类型
    jkzzjlx(e) {
        if ((chaninese.test(e.detail.value))) {
            wx.showToast({
                title: '只允许输入中文',
                icon: 'none'
            })
            this.setData({
                jkzzjlx: '',
            })
        } else {
            this.setData({
                jkzzjlx: e.detail.value,
            })
        }
    },
    // 输入注册证类型
    cyzzjlx(e) {
        if ((chaninese.test(e.detail.value))) {
            wx.showToast({
                title: '只允许输入中文',
                icon: 'none'
            })
            this.setData({
                cyzzjlx: ''
            })
        } else {
            this.setData({
                cyzzjlx: e.detail.value
            })
        }
    },
    // 上传
    chuan(e) {
        var aaa = e.currentTarget.dataset.aaa //店头营业执照
        var that = this;
        this.myChooseImage(1).then(res => {
            const tempFilePaths = res.tempFilePaths
            this.myUploadImg(tempFilePaths[0], 'file').then(res => {
                var data = JSON.parse(res.data)
                wx.showToast({
                    title: data.msg,
                    icon: 'none'
                })
                var urls = data.httpUrl + data.imgUrl
                if (aaa == 0) {
                    that.setData({
                        jkz: urls,
                        wujkz: data.imgUrl,
                        jkis_dian: true,
                    });
                }
                if (aaa == 1) {
                    that.setData({
                        cyz: urls,
                        wucyz: data.imgUrl,
                        zcis_dian: true
                    });
                }
                if (aaa == 2) {
                    that.setData({
                        byz: urls,
                        wubyz: data.imgUrl,
                        byis_dian: true
                    });
                }
                if (aaa == 3) {
                    that.setData({
                        zgz: urls,
                        wuzgz: data.imgUrl,
                        zgis_dian: true
                    });
                }
                if (aaa == 4) {
                    that.setData({
                        otherimg: urls,
                        wuotherimg: data.imgUrl,
                        // zgis_dian: true
                    });
                }
            })
        })
    },
    // 职位
    zhiwei(e) {
        let index = e.detail.value
        this.setData({
            zhiguo: this.data.zhilist[e.detail.value].name,
            zhiweiid: this.data.zhilist[e.detail.value].id
        });
    },
    // 填写姓名
    xingming(e) {
        this.setData({
            xingming: e.detail.value
        })
    },
    // 填写电话
    dianhua(e) {
        var value = e.detail.value
        console.log(value)
        if (!chaninese.test(value)) {
            wx.showToast({
                title: '只能输入数字！',
                icon: 'error'
            })
            // this.setData({
            //   dianhua: ''
            // })
        }
        if (value.length == 11) {
            if (!mobile.test(value)) {
                wx.showToast({
                    title: '格式不正确！',
                    icon: 'error'
                })
            } else {
                this.setData({
                    dianhua: value
                })
            }
        }
    },
    // 填写身份证
    shenfenz(e) {
        this.setData({
            shenfenz: e.detail.value
        })
    },
    // 健康证选择开始时间
    bindDateChange: function (e) {
        if (new Date(e.detail.value).getTime() > Date.parse(new Date())) {
            wx.showToast({
                title: '有效期不可大于当前时间',
                icon: 'none'
            })
            this.setData({
                date: '',
                datas:'',
                jkis_dian: false,
            })
            return
        }else{
            this.setData({
                date: e.detail.value,
                jkis_dian: true
            })
        }
        let date = new Date(this.data.date);
        let year = date.getFullYear() + 1
        let month = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1);
        let day = (date.getDate() < 10 ? "0" + (date.getDate()) : date.getDate());
        this.setData({
            dates: year + '-' + month + '-' + day
        })
    },
    // 健康证选择结束时间
    // bindDateChanges: function (e) {
    //   if (new Date(e.detail.value).getTime() < Date.parse(new Date())) {
    //     wx.showToast({
    //       title: '有效期不可小于当前时间',
    //       icon: 'none'
    //     })
    //     this.setData({
    //       dates: '请选择健康证有效期'
    //     })
    //   } else {
    //     this.setData({
    //       dates: e.detail.value
    //     })
    //   }
    // },
    // 注册证选择开始时间
    bindcyzqu: function (e) {


      if (new Date(e.detail.value).getTime() > Date.parse(new Date())) {
        wx.showToast({
          title: '取证时间不可大于当前时间',
          icon: 'none'
        })
        this.setData({
          cyzdatequ: '',
        //   zcis_dian: false
        })
      }else{
        this.setData({
          cyzdatequ: e.detail.value,
          cyzdatequs: e.detail.value,
          zcis_dian: true
        })
      } 

        // this.setData({
        //     cyzdatequ: e.detail.value,
        //     cyzdatequs: e.detail.value,
        //     zcis_dian: true
        // })
    },

    bindotherqu: function (e) {
        if (new Date(e.detail.value).getTime() > Date.parse(new Date())) {
            wx.showToast({
              title: '有效期不可小于当前时间',
              icon: 'none'
            })
            this.setData({
                otherqu: '',
            //   zcis_dian: false
            })
          } else{
              this.setData({
                  otherqu: e.detail.value,
                  otherquChuan: e.detail.value,
                  // zcis_dian: true
              })
          }
    },


    // 注册证选择结束时间
    bindcyzdao: function (e) {
        if (new Date(e.detail.value).getTime() < Date.parse(new Date())) {
            wx.showToast({
                title: '有效期不可小于当前时间',
                icon: 'none'
            })
            this.setData({
                cyzdatedao: '',
                zcis_dian: false
            })
        } else {
            this.setData({
                cyzdatedao: e.detail.value,
                cyzdatedaos: e.detail.value,
                zcis_dian: true
            })
        }
    },

    otheryoudao: function (e) {
        if (new Date(e.detail.value).getTime() < Date.parse(new Date())) {
            wx.showToast({
                title: '有效期不可小于当前时间',
                icon: 'none'
            })
            this.setData({
                otheryou: '',
                // zcis_dian: false
            })
        } else {
            this.setData({
                otheryou: e.detail.value,
                otheryouChuan: e.detail.value,
                // zcis_dian: true
            })
        }
    },

    //毕业证选择取证时间
    bindbiye(e) {
        this.setData({
            bytime: e.detail.value,
            bytimes: e.detail.value,
            byis_dian: true
        })
    },
    //资格证选择取证时间
    bindzige: function (e) {
        this.setData({
            zgtime: e.detail.value,
            zgis_dian: true
        })
    },
    bindzigesa: function (e){
      this.setData({

      zgtimes: e.detail.value,
      zgis_dian: true
    })

    },
    sheng() {
        wx.navigateTo({
            url: '/my_other/xinxilr/xinxilr',
        })
    },
    inputFocus(e) {
        console.log(e, '弹起');
        console.log(e.detail.height);
        this.setData({
            inputHeight: e.detail.height * 2
        })
        // setTimeout(() => {
        wx.pageScrollTo({
            scrollTop: 999999,
            duration: 0
        });
        // }, 200)
    },
    inputBlur() {
        this.setData({
            inputHeight: 0
        })
    },
    backs() {
        wx.navigateBack({
            delta: 0
        })
        wx.setStorageSync('zhan', 0)
       
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.setData({
            heights: wx.getMenuButtonBoundingClientRect().top + 5,
            jinghe_id: wx.getStorageSync('jinghe_id'),
            hangyeid: wx.getStorageSync('stryId'),
            scene: wx.getStorageSync('scene')
        })
        console.log(options)
        var scene = options.scene
        if (scene) {
            var istoken = scene.slice(-1) //0不用token 1需要
            this.setData({
                istoken: istoken,
            })
        }
      
        if (this.data.hangyeid == 6) {
            this.setData({
                xuan_list: [{
                        name: '健康证',
                        checked: false
                    }, {
                        name: '资格证',
                        checked: false
                    }, {
                        name: '注册证',
                        checked: false
                    },
                    {
                        name: '其他证照',
                        checked: false
                    },

                ]
            })
        } else {
            this.setData({
                xuan_list: [{
                    name: '健康证',
                    checked: false
                }, {
                    name: '从业证',
                    checked: false
                }, {
                    name: '其他证照',
                    checked: false
                }]
            })
        }


       
    },
    goqtcy(e) {
        wx.navigateTo({
            url: '/page_other/qitacy/qitacy',
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.setData({
            zhan: wx.getStorageSync('zhan'),
            yiyao: wx.getStorageSync('stryId')
        })
        if (this.data.zhan == 99) {
            this.setData({
                cyz: wx.getStorageSync('cyimg'),
                cyzdatequ: wx.getStorageSync('cystartime'),
                cyzdatedao: wx.getStorageSync('cyendtime')
            })
            console.log(this.data.cyz)
        }

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },
})